package com.cn.serverline.lineicp.productionLine.controller;

import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import com.cn.serverline.lineicp.productionLine.entity.NodeDivisionDetails;
import com.cn.serverline.lineicp.productionLine.service.INodeDivisionDetailsService;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * 交付计划划分节点详情 接口
 *
 * @author 郭明然
 * @since 2024-08-22
 */
@RestController
@ApiResource(name = "交付计划划分节点详情的接口")
public class NodeDivisionDetailsController {

    @Resource(name = "NodeDivisionDetailsServiceImpl")
    private INodeDivisionDetailsService iNodeDivisionDetailsService;

    /**
     * 添加交付计划划分节点详情
     */
    @PostResource(name = "添加交付计划划分节点详情", path = "/productionLine/nodeDivisionDetails/add")
    public ResponseData<NodeDivisionDetails> add(@RequestBody @Validated NodeDivisionDetails nodeDivisionDetails){
        iNodeDivisionDetailsService.add(nodeDivisionDetails);
        return new SuccessResponseData<>();
    }

    /**
     * 删除交付计划划分节点详情
     */
    @PostResource(name = "删除交付计划划分节点详情", path = "/productionLine/nodeDivisionDetails/delete")
    public ResponseData<?> delete(@RequestBody @Validated NodeDivisionDetails  nodeDivisionDetails){
        iNodeDivisionDetailsService.del(nodeDivisionDetails);
        return new SuccessResponseData<>();
    }

    /**
     * 编辑交付计划划分节点详情
     */
    @PostResource(name = "编辑交付计划划分节点详情", path = "/productionLine/nodeDivisionDetails/edit")
    public ResponseData<?> edit(@RequestBody @Validated NodeDivisionDetails nodeDivisionDetails) {
        iNodeDivisionDetailsService.edit(nodeDivisionDetails);
        return new SuccessResponseData<>();
    }

    /**
     * 分页查询-交付计划划分节点详情列表
     */
    @GetResource(name = "分页查询-交付计划划分节点详情列表", path = "/productionLine/nodeDivisionDetails/page")
    public ResponseData<PageResult<NodeDivisionDetails>> page(NodeDivisionDetails nodeDivisionDetails) {
        return new SuccessResponseData<>(iNodeDivisionDetailsService.findPage(nodeDivisionDetails));
    }

}
